<?php foreach($arr as $user): ?>
<div id="editUser<?=$user['id'] ?>" class="popupdiv">
<h3>Modify existing user</h3>
<?= form_open('user_manager/manageUser') ?>
<input type="hidden" name="uid" value="<?=$user['id'] ?>" />
<label for="firstname<?=$user['id'] ?>">Firstname: </label><input id="firstname<?=$user['id'] ?>" type="text" name="firstname" value="<?=$user['firstname'] ?>" /><br />
<label for="surname<?=$user['id'] ?>">Surname: </label><input id="surname<?=$user['id'] ?>" type="text" name="surname" value="<?=$user['surname'] ?>" /><br />
<label for="email<?=$user['id'] ?>">Email: </label><input id="email<?=$user['id'] ?>" type="text" name="email" value="<?=$user['email'] ?>" /><br />
<label for="login<?=$user['id'] ?>">Login: </label><input id="login<?=$user['id'] ?>" type="text" name="login" value="<?=$user['login'] ?>" /><br />
<label for="pass<?=$user['id'] ?>">Password: </label><input id="pass<?=$user['id'] ?>" type="password" name="pass" /><br />
<span class="small">Only if you want to change the password</span><br />
<label for="level<?=$user['id'] ?>">Level: </label><select name="level" id="level<?=$user['id'] ?>">
<option value="1" <?php if($user['level'] == 1) echo ("selected=\"selected\""); ?>>Employee</option>
<option value="99" <?php if($user['level'] == 99) echo ("selected=\"selected\""); ?>>Employer / Administrator</option>
</select><br />
<label for="delete<?=$user['id'] ?>">Delete user</label><input type="checkbox" value="1" name="delete" id="delete<?=$user['id'] ?>" /><br />
<p align="center">
<input type="submit" value="Submit edited info" style="width: 200px; margin: 0 auto;" />
</p>
</form>
<a href="#" onclick="$('#editUser<?=$user['id'] ?>').hide(); return false;">Cancel</a>
</div>
<?php endforeach; ?>
<div id="addNewDiv" class="popupdiv">
<h3>Add new user</h3>
<?= form_open('user_manager/newUser') ?>
<label for="firstname">Firstname: </label><input id="firstname" type="text" name="firstname"  /><br />
<label for="surname">Surname: </label><input id="surname" type="text" name="surname"  /><br />
<label for="email">Email: </label><input id="email" type="text" name="email"  /><br />
<label for="login">Login: </label><input id="login" type="text" name="login" /><br />
<label for="pass">Password: </label><input id="pass" type="password" name="pass" /><br />
<label for="level">Level: </label><select name="level" id="level">
<option value="1">Employee</option>
<option value="99">Employer / Administrator</option>
</select><br />
<p align="center">
<input type="submit" value="Add user" style="width: 200px; margin: 0 auto;" />
</p>
</form>
<a href="#" onclick="$('#addNewDiv').hide(); return false;">Cancel</a>
</div>
<h3>User management</h3>
<?= $user_table ?>
<a href="#" onclick="$('#addNewDiv').slideDown('slow'); return false;">Add new user</a>